import request from '@/utils/request';

/** 大屏页 */
// 查询失败率高的业务列表
export function queryBusinessFailRate(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ywgzt/home/queryBusinessFailRateTopN',
		method: 'post',
		data: data,
	});
}

// 查询响应耗时长的业务列表
export function queryBusinessLongTime(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ywgzt/home/queryBusinessResponseTimeTopN',
		method: 'post',
		data: data,
	});
}

// 查询区域业务统计
export function queryAreaBusinessStatistics(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ywgzt/home/queryAreaBusinessStatistics',
		method: 'post',
		data: data,
	});
}

// 查询地图数据
export function queryMapAreaBusinessStatistics(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ywgzt/home/queryMapAreaBusinessStatistics',
		method: 'post',
		data: data,
	});
}

// 查询最新健康度告警
export function queryRecentHealthRateAlarm(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ywgzt/home/queryRecentHealthRateAlarmTopN',
		method: 'post',
		data: data,
	});
}

// 查询系统访问量与告警量趋势
export function queryCompleteAlarmTrend(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ywgzt/home/queryCompleteAlarmTrend',
		method: 'post',
		data: data,
	});
}

// 获取刷新配置
export function queryRefreshConfig(): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ywgzt/system/configKey',
		method: 'get',
	});
}

// 设置刷新配置
export function updateRefreshConfig(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ywgzt/system/editDevOpsHomePageRefreshTime',
		method: 'post',
		data: data,
	});
}

// 获取头部统计数据
export function querySystemOverview(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ywgzt/home/headerInfo',
		method: 'post',
		data: data,
	});
}

// 系统域列表
export function querySystemDomainOption(): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ywgzt/system/getSystemDomainOption',
		method: 'get',
	});
}

// 搜索系统下拉框-根据系统分类查询系统及其健康度
export function getSystemHealthList(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ywgzt/system/getSystemHealthList',
		method: 'post',
		data: data,
	});
}

/** 弹框相关 */
// 响应慢业务告警更多列表
export function queryAlarmList(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ywgzt/alarm/responSlow/alarmList',
		method: 'post',
		data: data,
	});
}

// 响应慢业务告警详情列表
export function queryAlarmDetailList(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ywgzt/alarm/responSlow/alarmDetailList',
		method: 'post',
		data: data,
	});
}

// 全系统失败率高的业务列表
export function queryBusinessFailRateList(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ywgzt/failRate/getBusinessFailList',
		method: 'post',
		data: data,
	});
}

// 失败率告警详情列表
export function queryBusinessFailRateDetailList(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ywgzt/failRate/getBusinessFailDetailList',
		method: 'post',
		data: data,
	});
}

// 健康度告警列表
export function queryRecentHealthRateAlarmList(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ywgzt/alarm/responSlow/singleSystemAlarmList',
		method: 'post',
		data: data,
	});
}

// 健康度告警详情列表
export function queryRecentHealthRateAlarmDetailList(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ywgzt/alarm/responSlow/singleAlarmDetailList',
		method: 'post',
		data: data,
	});
}

// 业务告警Top5
export function queryBusiAlarmList(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ywgzt/home/business/busiAlarmTop',
		method: 'post',
		data: data,
	});
}

// 关键业务健康状况
export function getKeyBusiHealthList(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ywgzt/home/business/busiHealthTop',
		method: 'post',
		data: data,
	});
}

// 观察区列表
export function queryObservationArealList(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ywgzt/newestAlarm/getObservationArealList',
		method: 'post',
		data: data,
	});
}
